#version 450 core

layout(location = 0) in vec4 vColor;    
layout(location = 1) in vec2 vTexCoord;
layout(location = 2) in flat float vTexIndex;

layout(location = 0) out vec4 FragColor; 

layout(location = 0) uniform sampler2D uTextures[32];

void main()
{
	vec4 texColor = vColor * texture(uTextures[int(vTexIndex)],vTexCoord);
	FragColor = texColor;
}